/**
 * userStatus
 *
 * 登陆的时候判断，login 接口中返回的userStatus
 * 0正常 1停用 3入驻中间态
 * 3的时候跳入驻界面
 */
export const USER_STATUS_OBJECT = {
  正常: 0,
  停用: 1,
  入驻中间态: 3,
};

/***
 * 系统类型 - 角色登陆 userType
 * ---------
 * PLATFORM("10", "平台方"),
 * DECORATION_COMPANY("MC02", "装修公司"),
 * MATERIALS_COMPANY("MC03", "家居建材"),
 * DESIGNER("ME01", "设计师"),
 * EMPLOYEE("24", "从业人员"),
 * CONSUMER("30", "消费者"),
 *
 * @key 与 DECORATION_COMPANY 的 key 一致
 */
export const SYSTEM_TYPE_OBJECT = {
  P01: "平台方",
  P02: "渠道合伙人",
  P03: "高级合伙人",
  MC00: "公司职员",
  MC01: "服务商",
  MC02: "装修公司",
  MC03: "家居建材",
  ME01: "设计师",
  ME02: "项目经理",
  ME03: "经纪人",
  ME04: "销售员",
  ME05: "工人",
  C01: "消费者",
  ANON: "匿名用户",
};

export const SYSTEM_TYPE_LIST = Object.keys(SYSTEM_TYPE_OBJECT).map((key) => ({
  label: SYSTEM_TYPE_OBJECT[key],
  value: key,
}));

// 反向获取 - 跟上面保持统一，key都不能随便改哦
export const SYSTEM_TYPE_REVERSE_OBJECT = {
  平台方: "P01",
  渠道合伙人: "P02",
  高级合伙人: "P03",
  公司职员: "MC00",
  服务商: "MC01",
  装修公司: "MC02",
  家居建材: "MC03",
  项目经理: "ME02",
  设计师: "ME01",
  经纪人: "ME03",
  销售员: "ME04",
  工人: "ME05",
  消费者: "C01",
  匿名用户: "ANON",
};
// 主页根据不同类型展示不同的主页
export const SYSTEM_INDEXPAGE_OBJECT = {
  MC02: [
    {
      id: "5",
      name: "擅长户型",
      dictCode: "HouseStructure",
      fieldName: "skilledHouseLayout",
      type: "tree",
    },
    {
      id: "8",
      name: "服务范围",
      dictCode: "DecorationForm",
      fieldName: "serviceRange",
      type: "tree",
    },
    { id: "6", name: "装修类型", dictCode: "HouseType", fieldName: "decorationType", type: "tree" },
    {
      id: "4",
      name: "装修风格",
      dictCode: "DecorationStyle",
      fieldName: "skilledStyle",
      type: "tree",
    },
    { id: "10", name: "价格区间", dictCode: "PriceRange", fieldName: "priceRange", type: "tree" },
  ],
  MC03: [
    // {
    //   id: "5",
    //   name: "擅长户型",
    //   dictCode: "HouseStructure",
    //   fieldName: "skilledHouseLayout",
    //   type: "tree",
    // },
    // { id: "6", name: "装修类型", dictCode: "HouseType", fieldName: "decorationType", type: "tree" },
    // {
    //   id: "1001",
    //   name: "经营品牌",
    //   dictCode: "manageBrand",
    //   fieldName: "manageBrand",
    //   type: "tag",
    // },
    // {
    //   id: "1002",
    //   name: "经营品类",
    //   dictCode: "materialCategory",
    //   fieldName: "materialCategory",
    //   type: "tree",
    // },
  ],
  ME01: [
    {
      id: "5",
      name: "擅长户型",
      dictCode: "HouseStructure",
      fieldName: "skilledHouseLayout",
      type: "tree",
    },
    {
      id: "8",
      name: "服务范围",
      dictCode: "DecorationForm",
      fieldName: "serviceRange",
      type: "tree",
    },
    { id: "6", name: "装修类型", dictCode: "HouseType", fieldName: "decorationType", type: "tree" },
    {
      id: "4",
      name: "装修风格",
      dictCode: "DecorationStyle",
      fieldName: "skilledStyle",
      type: "tree",
    },
  ],
  // 24: [
  //   { id: "5", name: "擅长户型", dictCode: "HouseStructure", fieldName: "skilledHouseLayout" },
  //   { id: "8", name: "服务范围", dictCode: "DecorationForm", fieldName: "serviceRange" },
  //   { id: "6", name: "装修类型", dictCode: "HouseType", fieldName: "decorationType" },
  //   { id: "4", name: "装修风格", dictCode: "DecorationStyle", fieldName: "skilledStyle" },
  //   { id: "10", name: "价格区间", dictCode: "PriceRange", fieldName: "priceRange" },
  // ],
};

// 入驻类型的枚举，只有这三种身份需要入驻
export const SETTLE_TYPE_OBJECT = {
  MC02: "装修公司",
  MC03: "家居建材",
  ME01: "设计师",
  ME02: "项目经理",
};
export const SETTLE_TYPE_LIST = Object.keys(SETTLE_TYPE_OBJECT).map((key) => ({
  label: SETTLE_TYPE_OBJECT[key],
  value: key,
}));

/**
 * 装修公司进来：装修公司、设计机构/工作室
 * 家居建材进来：材料商、服务商
 * 设计师进来：设计师
 * 从业人员进来：从业人员
 * 消费者进来：消费者
 * @key 与 SYSTEM_TYPE_OBJECT 的 key 一致
 */
// 主体类型列表
export const SUBJECT_TYPE_ENUM = {
  // 这一块的代码得好像需要删掉，现在是没有subject_type 了，具体的可以问下tech
  21: [
    {
      label: "装修公司",
      value: "01",
    },
    {
      label: "设计机构",
      value: "02",
    },
    {
      label: "工作室",
      value: "03",
    },
  ],
  22: [
    {
      label: "材料商",
      value: "10",
    },
    {
      label: "服务商",
      value: "11",
    },
  ],
  23: [
    {
      label: "个人",
      value: "21",
    },
  ],
  25: [
    {
      label: "个人",
      value: "21",
    },
  ],
};

export const COMPANY_PROPERTY_ENUM = [
  {
    label: "主体类型",
    fieldName: "subjectType",
  },
  {
    label: "统一社会信用代码",
    fieldName: "unifiedSocialCredit",
  },
  {
    label: "公司名称",
    fieldName: "companyName",
  },
  {
    label: "营业执照住所",
    fieldName: "businessAddress",
  },
  {
    label: "营业期限",
    fieldName: "licenseValidity",
  },
  {
    label: "法人代表归属地",
    fieldName: "legalRepresentative",
  },
  {
    label: "身份证图片",
    fieldName: "idCardBackFile",
    image: true,
  },
  {
    label: "法人代表姓名",
    fieldName: "legalRepresentative",
  },
  {
    label: "法人身份证号码",
    fieldName: "idNumber",
  },
  {
    label: "身份证有效期",
    fieldName: "idCardValidity",
    type: "Array",
  },
  {
    label: "业务负责人姓名",
    fieldName: "businessContactName",
  },
  {
    label: "业务负责人手机号",
    fieldName: "businessContactPhone",
  },
  {
    label: "营业执照文件",
    fieldName: "businessLicenseFile",
    image: true,
  },
  {
    label: "商标或品牌授权",
    fieldName: "brandAuthorizationFile",
    image: true,
  },
  {
    label: "经营许可证",
    fieldName: "businessPermitFile",
    image: true,
  },
  {
    label: "法人代表身份证正面",
    fieldName: "idCardFrontFile",
    image: true,
  },
  {
    label: "法人代表身份证反面",
    fieldName: "idCardBackFile",
    image: true,
  },
  {
    label: "法人授权书",
    fieldName: "legalAuthorizationFile",
    image: true,
  },
  {
    label: "资质证明",
    fieldName: "qualificationProofFile",
    image: true,
  },
  // {
  //   label: "商圈名称",
  //   fieldName: "mallName",
  // },
];
export const EMPLOYEE_PROPERTY_ENUM = [
  {
    label: "主体类型",
    fieldName: "subjectType",
  },
  // {
  //   label: "商圈名称",
  //   fieldName: "mallName",
  // },
  {
    label: "姓名",
    fieldName: "businessContactName",
  },
  {
    label: "手机号",
    fieldName: "businessContactPhone",
  },
  {
    label: "身份证号码",
    fieldName: "idNumber",
  },
  {
    label: "身份证有效期",
    fieldName: "idCardValidity",
  },
  {
    label: "身份证正面",
    fieldName: "idCardFrontFile",
    image: true,
  },
  {
    label: "身份证反面",
    fieldName: "idCardBackFile",
    image: true,
  },
];
